package com.junyu.common;

import lombok.Getter;

/**
 * 响应状态码枚举类
 */
@Getter
public enum ResultCodeEnum {
    /**
     * 响应状态码对象
     */
    SUCCESS(200, "success"),
    FAIL(-1, "未知错误"),
    PASSWORD_FORMAT_ERROR(101, "密码格式错误"),
    USER_NOT_EXIST(102, "用户不存在"),
    USER_EXIST(103, "用户已存在"),
    USER_NAME_FORMAT_ERROR(104, "用户名格式错误"),
    EMAIL_FORMAT_ERROR(105, "邮箱格式错误"),
    EMAIL_NOT_EXIST(106, "邮箱不存在"),
    EMAIL_EXIST(107, "邮箱已存在"),
    CODE_ERROR(108, "验证码错误"),
    PASSWORD_ERROR(109, "密码错误"),
    EMAIL_SEND_ERROR(110, "邮箱发送失败"),
    ACCOUNT_OR_PASSWORD_NULL(111, "账号或用户名为空"),
    EMAIL_IS_NULL(112, "邮箱为空"),
    USER_NAME_EMAIL_NOT_ONLY(113, "用户名或邮箱不唯一"),
    USER_OLD_PASSWORD_ERROR(114, "旧密码错误"),
    LOGIN_PARAM_ERROR(115, "登录参数错误"),
    USER_NOT_LOGIN(401, "用户未登录");
    private Integer code;
    private String message;

    /**
     * 有参构造方法
     *
     * @param code    状态码
     * @param message 响应信息
     */
    private ResultCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}